gdk_display_close
gdk_display_device_is_grabbed
gdk_display_flush
+gdk_display_get_app_launch_context
gdk_display_get_default
gdk_display_get_default_cursor_size
gdk_display_get_default_group
static gchar * gdk_app_launch_context_get_display (GAppLaunchContext *context,
GAppInfo *info,
GList *files);
+static gchar * gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
+ GAppInfo *info,
+ GList *files);
+static void gdk_app_launch_context_launch_failed (GAppLaunchContext *context,
+ const gchar *startup_notify_id);
-G_DEFINE_TYPE (GdkAppLaunchContext, gdk_app_launch_context,
- G_TYPE_APP_LAUNCH_CONTEXT)
+G_DEFINE_TYPE (GdkAppLaunchContext, gdk_app_launch_context, G_TYPE_APP_LAUNCH_CONTEXT)
static void
gdk_app_launch_context_class_init (GdkAppLaunchContextClass *klass)
gobject_class->finalize = gdk_app_launch_context_finalize;
context_class->get_display = gdk_app_launch_context_get_display;
- context_class->get_startup_notify_id = _gdk_windowing_get_startup_notify_id;
- context_class->launch_failed = _gdk_windowing_launch_failed;
+ context_class->get_startup_notify_id = gdk_app_launch_context_get_startup_notify_id;
+ context_class->launch_failed = gdk_app_launch_context_launch_failed;
g_type_class_add_private (klass, sizeof (GdkAppLaunchContextPrivate));
}
gdk_app_launch_context_init (GdkAppLaunchContext *context)
{
context->priv = G_TYPE_INSTANCE_GET_PRIVATE (context,
- GDK_TYPE_APP_LAUNCH_CONTEXT,
- GdkAppLaunchContextPrivate);
+ GDK_TYPE_APP_LAUNCH_CONTEXT,
+ GdkAppLaunchContextPrivate);
context->priv->workspace = -1;
}
* using this context. See also gdk_app_launch_context_set_screen().
*
* Since: 2.14
+ *
+ * Deprecated: 3.0: Use gdk_display_get_app_launch_context() instead
*/
void
gdk_app_launch_context_set_display (GdkAppLaunchContext *context,
- GdkDisplay *display)
+ GdkDisplay *display)
{
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
g_return_if_fail (display == NULL || GDK_IS_DISPLAY (display));
- if (context->priv->display)
- {
- g_object_unref (context->priv->display);
- context->priv->display = NULL;
- }
-
- if (display)
- context->priv->display = g_object_ref (display);
+ g_warn_if_fail (display == NULL || display == context->priv->display);
}
/**
*/
void
gdk_app_launch_context_set_screen (GdkAppLaunchContext *context,
- GdkScreen *screen)
+ GdkScreen *screen)
{
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
g_return_if_fail (screen == NULL || GDK_IS_SCREEN (screen));
+ g_return_if_fail (screen == NULL || gdk_screen_get_display (screen) == context->priv->display);
+
if (context->priv->screen)
{
g_object_unref (context->priv->screen);
* @desktop: the number of a workspace, or -1
*
* Sets the workspace on which applications will be launched when
- * using this context when running under a window manager that
- * supports multiple workspaces, as described in the
- * <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended
- * Window Manager Hints</ulink>.
+ * using this context when running under a window manager that
+ * supports multiple workspaces, as described in the
+ * <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended
+ * Window Manager Hints</ulink>.
*
- * When the workspace is not specified or @desktop is set to -1,
+ * When the workspace is not specified or @desktop is set to -1,
* it is up to the window manager to pick one, typically it will
* be the current workspace.
*
*/
void
gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
- gint desktop)
+ gint desktop)
{
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
* @timestamp: a timestamp
*
* Sets the timestamp of @context. The timestamp should ideally
- * be taken from the event that triggered the launch.
+ * be taken from the event that triggered the launch.
*
* Window managers can use this information to avoid moving the
* focus to the newly launched application when the user is busy
*/
void
gdk_app_launch_context_set_timestamp (GdkAppLaunchContext *context,
- guint32 timestamp)
+ guint32 timestamp)
{
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
* @context: a #GdkAppLaunchContext
* @icon_name: (allow-none): an icon name, or %NULL
*
- * Sets the icon for applications that are launched with this context.
- * The @icon_name will be interpreted in the same way as the Icon field
- * in desktop files. See also gdk_app_launch_context_set_icon().
+ * Sets the icon for applications that are launched with this context.
+ * The @icon_name will be interpreted in the same way as the Icon field
+ * in desktop files. See also gdk_app_launch_context_set_icon().
*
* If both @icon and @icon_name are set, the @icon_name takes priority.
- * If neither @icon or @icon_name is set, the icon is taken from either
- * the file that is passed to launched application or from the #GAppInfo
+ * If neither @icon or @icon_name is set, the icon is taken from either
+ * the file that is passed to launched application or from the #GAppInfo
* for the launched application itself.
- *
+ *
* Since: 2.14
*/
void
gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context,
- const char *icon_name)
+ const char *icon_name)
{
g_return_if_fail (GDK_IS_APP_LAUNCH_CONTEXT (context));
* Returns: a new #GdkAppLaunchContext
*
* Since: 2.14
+ *
+ * Deprecated: 3.0: Use gdk_display_get_app_launch_context() instead
*/
GdkAppLaunchContext *
gdk_app_launch_context_new (void)
{
- return g_object_new (GDK_TYPE_APP_LAUNCH_CONTEXT, NULL);
+ return gdk_display_get_app_launch_context (gdk_display_get_default ());
+}
+
+static char *
+gdk_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
+ GAppInfo *info,
+ GList *files)
+{
+ return NULL;
+}
+
+static void
+gdk_app_launch_context_launch_failed (GAppLaunchContext *context,
+ const gchar *startup_notify_id)
+{
}
#define __GDK_APP_LAUNCH_CONTEXT_H__
#include <gio/gio.h>
+#include <gdk/gdktypes.h>
#include <gdk/gdkscreen.h>
G_BEGIN_DECLS
#define GDK_IS_APP_LAUNCH_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDK_TYPE_APP_LAUNCH_CONTEXT))
#define GDK_APP_LAUNCH_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_APP_LAUNCH_CONTEXT, GdkAppLaunchContextClass))
-typedef struct GdkAppLaunchContext GdkAppLaunchContext;
typedef struct GdkAppLaunchContextClass GdkAppLaunchContextClass;
typedef struct GdkAppLaunchContextPrivate GdkAppLaunchContextPrivate;
GdkModifierType *mask);
static GdkWindow* singlehead_default_window_at_pointer (GdkScreen *screen,
gint *win_x,
- gint *win_y);
-static GdkWindow *gdk_window_real_window_get_device_position (GdkDisplay *display,
+ gint *win_y);static GdkWindow *gdk_window_real_window_get_device_position (GdkDisplay *display,
GdkDevice *device,
GdkWindow *window,
gint *x,
GdkDevice *device,
gint *win_x,
gint *win_y);
+static GdkAppLaunchContext *gdk_display_real_get_app_launch_context (GdkDisplay *display);
static guint signals[LAST_SIGNAL] = { 0 };
object_class->finalize = gdk_display_finalize;
object_class->dispose = gdk_display_dispose;
+ class->get_app_launch_context = gdk_display_real_get_app_launch_context;
+
/**
* GdkDisplay::opened:
* @display: the object on which the signal is emitted
gdk_display_add_client_message_filter (gdk_display_get_default (),
message_type, func, data);
}
+
+static GdkAppLaunchContext *
+gdk_display_real_get_app_launch_context (GdkDisplay *display)
+{
+ GdkAppLaunchContext *ctx;
+
+ ctx = gdk_app_launch_context_new ();
+ gdk_app_launch_context_set_display (ctx, display);
+
+ return ctx;
+}
+
+/**
+ * gdk_display_get_app_launch_context:
+ * @display: a #GdkDisplay
+ *
+ * Returns a #GdkAppLaunchContext suitable for launching
+ * applications on the given display.
+ *
+ * Returns: a new #GdkAppLaunchContext for @display.
+ * Free with g_object_unref() when done
+ *
+ * Since: 3.0
+ */
+GdkAppLaunchContext *
+gdk_display_get_app_launch_context (GdkDisplay *display)
+{
+ return GDK_DISPLAY_GET_CLASS(display)->get_app_launch_context (display);
+}
GdkDeviceManager * gdk_display_get_device_manager (GdkDisplay *display);
+GdkAppLaunchContext *gdk_display_get_app_launch_context (GdkDisplay *display);
+
G_END_DECLS
GdkAtom message_type,
GdkFilterFunc func,
gpointer data);
+ GdkAppLaunchContext * (*get_app_launch_context) (GdkDisplay *display);
/* Signals */
char *icon_name;
};
-char *_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
- GAppInfo *info,
- GList *files);
-void _gdk_windowing_launch_failed (GAppLaunchContext *context,
- const char *startup_notify_id);
-
void _gdk_display_device_grab_update (GdkDisplay *display,
GdkDevice *device,
GdkDevice *source_device,
typedef struct _GdkWindow GdkWindow;
typedef struct _GdkDisplay GdkDisplay;
typedef struct _GdkScreen GdkScreen;
+typedef struct GdkAppLaunchContext GdkAppLaunchContext;
/**
* GdkByteOrder:
GdkQuartzView.h \
GdkQuartzWindow.c \
GdkQuartzWindow.h \
- gdkapplaunchcontext-quartz.c \
gdkcursor-quartz.c \
gdkdevice-core.c \
gdkdevicemanager-core.c \
+++ /dev/null
-/* gdkapplaunchcontext-quartz.c - Gtk+ implementation for GAppLaunchContext
-
- Copyright (C) 2007 Red Hat, Inc.
-
- The Gnome Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-
- Author: Matthias Clasen <mclasen@redhat.com>
-*/
-
-#include "config.h"
-
-#include "gdkapplaunchcontext.h"
-
-
-char *
-_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
- GAppInfo *info,
- GList *files)
-{
- return NULL;
-}
-
-void
-_gdk_windowing_launch_failed (GAppLaunchContext *context,
- const char *startup_notify_id)
-{
-}
-
-
libgdk_win32_la_SOURCES = \
xcursors.h \
- gdkapplaunchcontext-win32.c \
gdkcursor-win32.c \
gdkdevicemanager-win32.c \
gdkdevicemanager-win32.h \
+++ /dev/null
-/* gdkapplaunchcontext-win32.c - Gtk+ implementation for GAppLaunchContext
-
- Copyright (C) 2007 Red Hat, Inc.
-
- The Gnome Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-
- Author: Matthias Clasen <mclasen@redhat.com>
-*/
-
-#include "config.h"
-
-#include "gdkapplaunchcontext.h"
-
-
-char *
-_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
- GAppInfo *info,
- GList *files)
-{
- return NULL;
-}
-
-void
-_gdk_windowing_launch_failed (GAppLaunchContext *context,
- const char *startup_notify_id)
-{
-}
-
-
#include "config.h"
#include "gdkapplaunchcontext.h"
+#include "gdkinternals.h"
#include "gdkx.h"
#include "gdkscreen.h"
-#include "gdkinternals.h"
#include "gdkintl.h"
#include <glib.h>
}
-char *
-_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
- GAppInfo *info,
- GList *files)
+static char *
+gdk_app_launch_context_x11_get_startup_notify_id (GAppLaunchContext *context,
+ GAppInfo *info,
+ GList *files)
{
static int sequence = 0;
GdkAppLaunchContextPrivate *priv;
priv = GDK_APP_LAUNCH_CONTEXT (context)->priv;
+ display = priv->display;
if (priv->screen)
- {
- screen = priv->screen;
- display = gdk_screen_get_display (priv->screen);
- }
- else if (priv->display)
- {
- display = priv->display;
- screen = gdk_display_get_default_screen (display);
- }
+ screen = priv->screen;
else
- {
- display = gdk_display_get_default ();
- screen = gdk_display_get_default_screen (display);
- }
+ screen = gdk_display_get_default_screen (priv->display);
fileinfo = NULL;
}
-void
-_gdk_windowing_launch_failed (GAppLaunchContext *context,
- const char *startup_notify_id)
+static void
+gdk_app_launch_context_x11_launch_failed (GAppLaunchContext *context,
+ const char *startup_notify_id)
{
GdkAppLaunchContextPrivate *priv;
GdkScreen *screen;
if (priv->screen)
screen = priv->screen;
- else if (priv->display)
- screen = gdk_display_get_default_screen (priv->display);
else
- screen = gdk_display_get_default_screen (gdk_display_get_default ());
+ screen = gdk_display_get_default_screen (priv->display);
data = g_object_get_data (G_OBJECT (screen), "appinfo-startup-data");
}
}
}
+
+typedef struct GdkAppLaunchContext GdkAppLaunchContextX11;
+typedef struct GdkAppLaunchContextClass GdkAppLaunchContextX11Class;
+
+G_DEFINE_TYPE (GdkAppLaunchContextX11, _gdk_app_launch_context_x11, GDK_TYPE_APP_LAUNCH_CONTEXT)
+
+static void
+_gdk_app_launch_context_x11_class_init (GdkAppLaunchContextX11Class *klass)
+{
+ GAppLaunchContextClass *ctx_class = G_APP_LAUNCH_CONTEXT_CLASS (klass);
+
+ ctx_class->get_startup_notify_id = gdk_app_launch_context_x11_get_startup_notify_id;
+ ctx_class->launch_failed = gdk_app_launch_context_x11_launch_failed;
+}
+
+static void
+_gdk_app_launch_context_x11_init (GdkAppLaunchContextX11 *ctx)
+{
+}
+
+GdkAppLaunchContext *
+_gdk_x11_display_get_app_launch_context (GdkDisplay *display)
+{
+ GdkAppLaunchContext *ctx;
+
+ ctx = g_object_new (_gdk_app_launch_context_x11_get_type (), NULL);
+ gdk_app_launch_context_set_display (ctx, display);
+
+ return ctx;
+}
gdk_x11_display_error_trap_pop_internal (display, FALSE);
}
+extern GdkAppLaunchContext *_gdk_x11_display_get_app_launch_context (GdkDisplay *display);
+
static void
_gdk_display_x11_class_init (GdkDisplayX11Class * class)
{
display_class->list_devices = gdk_x11_display_list_devices;
display_class->send_client_message = gdk_x11_display_send_client_message;
display_class->add_client_message_filter = gdk_x11_display_add_client_message_filter;
+ display_class->get_app_launch_context = _gdk_x11_display_get_app_launch_context;
}